<template>
  <div>
    <div class="pageheader flexbetween">
      <div>
        <div
          v-for="(item, index) in list"
          :key="index"
          class="pageitem commhover c_text f-14 fw-6"
          :class="{ active: activeId === item.id }"
          @click="handleTab(item)"
        >
          {{ item.name }}
        </div>
      </div>
      <el-button
        v-hasPermi="['system:multigroupforward:sendset']"
        plain
        size="small"
        @click="handleSet"
        >发送设置</el-button
      >
    </div>
    <div class="pagewrapper2">
        <!-- 当前任务 -->
      <CurrentTask v-if="activeId==1" />
      <!-- 保存的任务 -->
      <save-task v-if="activeId==2" />
      <AddTranspond v-if="activeId==3" />
    </div>

    <send-set v-if="showset" :visableIf.sync="showset"/>
  </div>
</template>
<script>
import CurrentTask from './CurrentTask.vue'
import SaveTask from './SaveTask.vue';
import SendSet from './SendSet.vue'
// import { mapGetters } from "vuex";
export default {
  data() {
    return {
      list: [
        { name: "当前转发任务", id: 1 },
        { name: "我保存的转发任务", id: 2 },
      ],
      activeId: 1,
      keys: "",
      showset:false
    };
  },
  components: {
    SendSet,
    CurrentTask,
    SaveTask
  },
  methods: {
    handleTab(item) {
      this.activeId = item.id;
      this.keys = Date.now();
      console.log("item:", item, this.activeId);
      //   this.$router.push({name:item.name})
    },

    handleSet() {
      this.showset = true
    },
  },
};
</script>
<style lang="scss" scoped>
.pageheader {
  width: 100%;
  height: 46px;
  position: sticky;
  top: 0;
  z-index: 8;
  height: 46px;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid #e9e9e9;
}
.pageitem {
  display: inline-block;
  height: 100%;
  line-height: 46px;
  border-bottom: 2px solid transparent;
  width: auto;

  &.active {
    color: #3070ff;
    border-bottom-color: #3070ff;
  }
  &:not(:first-child) {
    margin-left: 32px;
  }
}
.pagewrapper2 {
  padding: 16px;
  height: calc(100vh - 48px - 46px);
}
</style>
